package com.yinpeng;

import org.springframework.context.annotation.Bean;

/**
 * Created by yinpeng on 2020/06/28
 */
public class TestBean {

	public static void main(String[] args) {
		System.out.println("");
	}

	@Bean
	private A getA(){
		return new A();
	}

	/**
	 * 如果getA()方法在调用之前A对象已经创建好则不会在此初始化
	 * */
	@Bean
	private B getB(){
		getA();
		return new B();
	}

	private class A{

	}

	private class B{}
}
